package com.abook23.tv.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.abook23.tv.ben.AppConfig;
import com.abook23.tv.ben.CacheVideoBean;
import com.abook23.tv.ben.MovieBen;

import com.abook23.tv.dao.AppConfigDao;
import com.abook23.tv.dao.CacheVideoBeanDao;
import com.abook23.tv.dao.MovieBenDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig appConfigDaoConfig;
    private final DaoConfig cacheVideoBeanDaoConfig;
    private final DaoConfig movieBenDaoConfig;

    private final AppConfigDao appConfigDao;
    private final CacheVideoBeanDao cacheVideoBeanDao;
    private final MovieBenDao movieBenDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        appConfigDaoConfig = daoConfigMap.get(AppConfigDao.class).clone();
        appConfigDaoConfig.initIdentityScope(type);

        cacheVideoBeanDaoConfig = daoConfigMap.get(CacheVideoBeanDao.class).clone();
        cacheVideoBeanDaoConfig.initIdentityScope(type);

        movieBenDaoConfig = daoConfigMap.get(MovieBenDao.class).clone();
        movieBenDaoConfig.initIdentityScope(type);

        appConfigDao = new AppConfigDao(appConfigDaoConfig, this);
        cacheVideoBeanDao = new CacheVideoBeanDao(cacheVideoBeanDaoConfig, this);
        movieBenDao = new MovieBenDao(movieBenDaoConfig, this);

        registerDao(AppConfig.class, appConfigDao);
        registerDao(CacheVideoBean.class, cacheVideoBeanDao);
        registerDao(MovieBen.class, movieBenDao);
    }
    
    public void clear() {
        appConfigDaoConfig.clearIdentityScope();
        cacheVideoBeanDaoConfig.clearIdentityScope();
        movieBenDaoConfig.clearIdentityScope();
    }

    public AppConfigDao getAppConfigDao() {
        return appConfigDao;
    }

    public CacheVideoBeanDao getCacheVideoBeanDao() {
        return cacheVideoBeanDao;
    }

    public MovieBenDao getMovieBenDao() {
        return movieBenDao;
    }

}
